Method of detecting an object with a proximity sensor

ABSTRACT

The disclosure relates to a method of detecting an object using a detection signal supplied by a proximity sensor. The method comprises the steps of generating a reference signal by filtering the value of the detection signal, defining a first detection threshold, and going from an object non-detecting state to an object detecting state when the value of the detection signal becomes greater than the first detection threshold. When the value of the detection signal becomes greater than the first detection threshold, the value of the reference signal is readjusted in a manner such that the value of the detection signal again becomes less than or respectively greater than, the first detection threshold.

BACKGROUND

Technical Field

The present disclosure relates to a method of detecting an object bymeans of a detection signal supplied by a proximity sensor.

The present disclosure relates in particular to object detectorscomprising a proximity sensor of the capacitive type.

Description of the Related Art

FIG. 1 schematically shows a conventional proximity detector DTC1.Detector DTC1 comprises a proximity sensor controller 10, a sensitiveportion 11, and a signal processing unit SPU1. Sensor controller 10comprises electronic means of controlling and of reading sensitiveportion 11, supplying a detection signal Sd. Signal Sd has a value, forexample its amplitude, that varies as a function of the distanceseparating an object 12 from sensitive portion 11. The value of signalSd also evolves depending on various environmental parameters such asthe temperature, the dielectric constant of air which is a function ofthe ambient humidity, the proximity of objects other than the detectedobject, etc.

Unit SPU1 ensures the processing of signal Sd and supplies a statesignal ST having two values DET and NDET, respectively signifying“object detected” or “object not detected”.

A conventional processing method of signal Sd as executed by unit SPU1is shown in FIGS. 2A, 2B. It is supposed here that signal Sd has a valuethat increases as the object approaches sensor 10. The method comprisesthe following steps:

-   -   unit SPU1 calculates a reference signal Sr, the value of which        varies more slowly than that of signal Sd, for example by        low-pass filtering of signal Sd,    -   unit SPU1 defines a detection threshold Th1 greater than        reference signal Sr, for example by adding an offset OF1 to the        value of reference signal Sr,    -   when the value of signal Sd becomes greater than threshold Th1,        unit SPU1 goes from non-detecting state NDET to detecting state        DET and freezes the value of reference signal Sr,    -   when the value of signal Sd again becomes less than threshold        Th1, unit SPU1 goes back into non-detecting state NDET and        releases reference signal Sr, which is again dynamically        generated by filtering of signal Sd.

In the example shown in FIG. 2A, signal Sd begins to increase at aninstant t0 and reaches threshold Th1 at an instant t1. Signal Sr doesnot vary perceptibly between t0 and t1 because it only copies the slowvariations of signal Sd. Signal Sr is then locked (i.e., frozen) frominstant t1 until an instant t2 where signal Sd again becomes less thanTh1. After instant t2, signal Sr still does not vary perceptibly becauseit does not copy the falling edge of short duration of signal Sd.

In a variant of this method, sensor controller 10 supplies a signal Sd,the value of which decreases as object 12 approaches the sensor.Detection threshold Th1 is in this case chosen to be less than referencesignal Sr and the detector goes into detecting state DET when the valueof signal Sd becomes less than threshold Th1.

In such a method, the freezing of reference signal Sr prevents it fromslowly approaching detection signal Sd, which would cause an undesirablereturn to the non-detecting state. Indeed, threshold Th1 would increasewith signal Sr and detection signal Sd would find itself, at one time oranother, less than threshold Th1.

Such a detecting method is satisfactory when the detecting time of anobject is short. However, in certain applications where the objectdetecting time may be long, a modification of environmental parametersduring the detection period of an object may lead to the detectorbecoming blocked.

FIGS. 3A, 3B illustrate this problem. The value of signal Sd begins toincrease at an instant t0 and reaches threshold Th1 at an instant t1,causing the freezing of signal Sr (FIG. 3A). The detector goes fromnon-detecting state NDET to detecting state DET (FIG. 3B). At an instantt2, the environmental parameters change and cause a new increase of thesignal Sd value, unrelated to a displacement of the object. At aninstant t3, the object leaves the field of detection of the sensor orceases to be in contact with the sensor. The value of signal Sddecreases to reach, at an instant t4, a lower value representative ofthe non-detecting state. This lower value is however greater thanthreshold Th1 due to the change of environmental parameters. Thedetector thus remains blocked in the detecting state.

This problem has been for example noticed in the following applications:

A proximity detector is integrated in the headphones of a digital musicplayer. The detector allows the sound to be stopped automatically whenthe user is no longer wearing the headphones. It has been noted that theformation or deposition of humidity on the sensitive surface of thesensor, for example due to transpiration by the user, causes the valueof detection signal Sd to increase. When the user removes theheadphones, the value of signal Sd remains high, as shown in FIG. 3A,and the proximity detector remains in the detecting state.

A proximity detector is integrated in a mobile telephone equipped with atouch pad. During a telephone conversation, the detector is used to lockthe touch pad and/or set the screen in low consumption mode when theuser approaches the telephone to his ears. It has also been noted thatthe detector may be blocked in the detecting state after the depositionor the formation of humidity on the sensitive portion of the sensor.This may happen during a telephone conversation or due to the fact thatthe telephone has suddenly changed environments (for example afterhaving been placed in a humid room such as a bathroom). In this case,the touchpad remains untimely locked, preventing the user from using thetelephone.

It may therefore be desired to provide a method of detecting an objectthat is more resistant to variations of environmental parametersaffecting the detection signal.

BRIEF SUMMARY

More particularly, embodiments of the disclosure relate to a method ofdetecting an object by means of a detection signal supplied by aproximity sensor, the detection signal having a value that increases, orrespectively decreases, as a function of the proximity of a detectedobject, the method comprising the steps of generating a reference signalby filtering the value of the detection signal, defining a firstdetection threshold relative to the reference signal, and going from anobject non-detecting state to an object detecting state when the valueof the detection signal becomes greater than, or respectively less than,the first detection threshold, wherein when the value of the detectionsignal becomes greater than, or respectively less than, the firstdetection threshold, the value of the reference signal is readjusted ina manner such that the value of the detection signal again becomes lessthan, or respectively greater than, the first detection threshold.

According to one embodiment, the method comprises a step of againreadjusting the value of the reference signal in a manner such that thevalue of the detection signal again becomes less than, or respectivelygreater than, the first detection threshold when, in the objectdetecting state, the value of the detection signal again becomes greaterthan, or respectively less than, the first detection threshold.

According to one embodiment, the method comprises the steps of defininga second detection threshold relative to the reference signal, goingfrom the object detecting state to the object non-detecting state whenthe value of the detection signal becomes less than, or respectivelygreater than, the second detection threshold, and when the value of thedetection signal becomes less than, or respectively greater than, thesecond detection threshold, readjusting the value of the referencesignal in a manner such that the value of the detection signal againbecomes greater than, or respectively less than, the second detectionthreshold.

According to one embodiment, the method comprises a step of againreadjusting the value of the reference signal in a manner such that thevalue of the detection signal again becomes greater than, orrespectively less than, the second detection threshold when, in theobject non-detecting state, the value of the detection signal againbecomes less than, or respectively greater than, the second detectionthreshold, without modifying the non-detecting state.

According to one embodiment, the second detection threshold is equal tothe value of the reference signal from which an offset is subtracted, orrespectively to which an offset is added.

According to one embodiment, the first detection threshold is equal tothe value of the reference signal to which an offset is added, orrespectively from which an offset is subtracted.

According to one embodiment, the readjustment of the value of thereference signal is done in a manner such that the value of thedetection signal is substantially equal to the value of the referencesignal with a maximum deviation less than the difference between thevalue of the readjusted reference signal and the detection threshold,the crossing of which causes the readjustment of the reference signal.

According to one embodiment, the readjustment of the value of thereference signal is done from values of the detection signal after theinstant where the value of the detection signal becomes greater than orless than the threshold.

According to one embodiment, the value of the detection signal is anamplitude, a frequency, a phase, a duration, or a number.

According to one embodiment, the step of going from the object detectingstate to the object non-detecting state, or vice-versa, comprises a stepof modifying the value of a state signal or a state register.

According to one embodiment, the object to detect is a part of the humanbody.

According to one embodiment, the detection signal is supplied by acapacitive proximity sensor.

Embodiments of the disclosure relate to a computer program product,comprising an executable code saved on a support to implement the methodaccording to one of the embodiments described above.

Embodiments of the disclosure relate to a proximity detector comprisinga proximity sensor supplying a detection signal having a value thatincreases, or respectively decreases, when an object approaches ortouches the sensor, a processing unit of microprocessor or hard-wiredtype, receiving the detection signal, wherein the processing unit isconfigured to implement the method according to one of the embodimentsdescribed above.

Embodiments of the disclosure relate to a portable device having atleast one element that can be activated and deactivated, and comprisingat least one detector according to the embodiment described above andbeing configured to activate or deactivate the element when an object isdetected in proximity of the device.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

Embodiments of the method of detecting an object according to disclosureand of an object detector according to disclosure will be described inthe following by reference, in a non-limiting manner, to the appendeddrawings among which:

FIG. 1 previously described schematically shows a conventional objectdetector,

FIGS. 2A, 2B previously described show signals appearing in the detectorin the absence of variations of environmental parameters,

FIGS. 3A, 3B previously described show a second example of signalsappearing in the detector in the presence of a variation ofenvironmental parameters,

FIG. 4 schematically shows a detector configured to implement the methodof the disclosure,

FIG. 5 is a flow chart describing an embodiment of the method of thedisclosure,

FIGS. 6A, 6B show signals appearing in the detector of FIG. 4 in theabsence of variations of environmental parameters,

FIGS. 7A, 7B show signals appearing in the detector of FIG. 4 in thepresence of a variation of environmental parameters,

FIG. 8 is a flow chart describing a second embodiment of the method ofthe disclosure, and

FIG. 9 schematically shows a portable object comprising a detectoraccording to the disclosure.

DETAILED DESCRIPTION

FIG. 4 schematically shows a detector DTC2 configured to implement anembodiment of the method of detecting an object according to disclosure.Detector DTC2 comprises a proximity sensor controller 10, a sensitiveportion 11, for example of the capacitive type, and a processing unitSPU2. Sensor controller 10 comprises electronic means of controlling andof reading the sensitive portion 11, supplying a detection signal Sd inanalog or digital form. Signal Sd has a value that varies between aminimum value Sdmin and a maximum value Sdmax as a function of thedistance separating an object 12 from sensitive portion 11. According tothe type of sensor used and the electronic control means structure, thisvalue may be an amplitude (of voltage or of current), a frequency, aphase, a duration, or a number, for example a number of pulses or ofcycles to transfer an electric charge.

The value of signal Sd also depends on environmental parameters such asthe temperature, the dielectric constant of air or the ambient humidity,the proximity of objects other than the object to detect, etc.

Unit SPU2 may be an analog circuit, a hard-wired circuit, or amicroprocessor or microcontroller circuit. It ensures the processing ofdetection signal Sd according to the method of the disclosure andsupplies a state signal ST having two values, DET and NDET, respectivelysignifying “object detected” or “object not detected”. State signal STmay be an analog or digital signal supplied by unit SPU2, a value in aread-accessible state register, or both.

An embodiment of the method according to disclosure is shown by the flowchart of FIG. 5. It is supposed in this example that the value ofdetection signal Sd increases when an object to detect approachessensitive portion 11. It is also supposed here that the processing ofsignal Sd is done by digital calculation, by means of a processorarranged in processing unit SPU2, equipped with a programmednon-volatile memory and a volatile memory (not shown). The programmedmemory receives an executable program implementing the method. Signal Sdmay be supplied by sensor controller 10 in analog or digital form. Inthe first case, signal Sd is sampled by unit SPU2, with a samplingfrequency Fs. In the second case, it is supplied in a digital form bythe sensor with a refresh frequency Fs.

The method comprises an initialization step S00 and an object detectingloop comprising steps S01 to S23.

Initialization step S00 comprises a step of determining an initial valueof a reference signal Sr, a step of determining two offsets OF1, OF2,and a step of initializing state signal ST.

The step of determining an initial value of reference signal Srcomprises a step of filtering detection signal Sd. Unit SPU2 uses forexample a unity gain second order digital low-pass filter of the“Infinite Impulsion Response” IRR type, having a time constant T1. Thisstep is performed during the time used to receive a sufficient number ofvalues of signal Sd, for example between 8 and 128 values.

The step of determining offsets OF1, OF2 may comprise a step of readingoffsets OF1, OF2 in memory zone where they are pre-stored. It may alsoinclude defining the offsets in a dynamic manner by taking intoconsideration the value of detection signal Sd to automatically adjustthe sensibility of the detector to the usage conditions. For example,unit SPU2 confers higher values to the offsets when the value of signalSd is high, and lower values when the value of signal Sd is low. To thisend, unit SPU2 may use a mathematical function that allows it tocalculate the offsets as a function of the value of signal Sr.Alternatively, unit SPU2 may use a correspondence table pre-saved in theprocessor memory, comprising a finite number of offset values, eachcorresponding to a value or to a range of values of the detectionsignal.

The step of initializing state signal ST consists of setting it, bydefault, in a non-detecting state NDET.

Once these preliminary steps have been executed, the object detectionloop is executed and repeated as long as detector DTC2 is active. Itcomprises steps S01, S02, S03, S04, S05, S10, S11, S12, S13, S20, S21,S22, and S23.

At step S01, unit SPU2 acquires a new value of signal Sd, supplied bysensor 10.

At step S02, unit SPU2 updates the current value of signal Sr byfiltering signal Sd including the new value received. This step is notnecessarily performed after each acquisition of a new value of signal Sdand may done every N acquisitions, that is, at a frequency Fs/N.

At step S03, unit SPU2 readjusts offsets OF1, OF2 by taking intoconsideration the new value of signal Sd. Like step S02, this step isnot necessarily performed after each acquisition of a new value ofsignal Sd and may be done every M acquisitions of new values, that is ata frequency Fs/M, M may be equal to N. This step may also not beexecuted if the offsets are not dynamically adjusted.

At step S04, unit SPU2 calculates a first detection threshold Th1 anddetermines whether the current value of detection signal Sd is greaterthan threshold Th1. threshold Th1 is calculated by adding offset OF1 tothe current value of reference signal Sr, that is if Th1=Sr+OF1. Ifsignal Sd is greater than Th1, unit SPU2 goes to step S10, otherwise tostep S05.

At step S05, unit SPU2 calculates a second detection threshold Th2 anddetermines whether the current value of detection signal Sd is less thanthreshold Th2. threshold Th2 is calculated by subtracting offset OF2from the current value of signal Sr, that is Th2=Sr−OF2. If signal Sd isless than Th2, unit SPU2 goes to step S20, otherwise it returns to stepS01.

At step S10, unit SPU2 determines whether the detector is in state DET,that is if ST=DET. If the response is negative, unit SPU2 goes to stepS11 where it puts the detector in state DET, then goes to step S12. Ifthe response is positive, unit SPU2 goes directly to step S12.

Step S12 is an optional delaying step before executing step S13.

At step S13, unit SPU2 readjusts signal Sr then returns to step S01.Step S13 may comprise a readjustment calculation phase followed by thereadjustment itself of signal Sr at the end of step S13, as it willappear later in relation with FIGS. 6A to 7B. The readjustment maytherefore be done in a quasi-instantaneous manner at the end of stepS13, but may also be done in a progressive manner throughout step S13.

At step S20, unit SPU2 determines whether the detector is in state DET,that is if ST=DET. If the response is positive, unit SPU2 goes to stepS21 where it puts the detector in state NDET, then goes to step S22. Ifthe response is negative, unit SPU2 goes directly to step S22.

Step S22 is, like step S12, an optional delaying step before executingstep S23.

At step S23, unit SPU2 readjusts signal Sr then returns to step S01.

In summary, readjustment step S13 or S23 intervenes after detectionsignal Sd has reached threshold Th1 or Th2. The reaching of thresholdTh1 also causes the detector to switch into state DET if it is notalready (step S11), and the reaching of threshold Th2 causes thedetector to switch into state NDET if it is not already (step S21).

The aim of the readjustment step of signal Sr is that signal Sd is againless than threshold Th1 that it reached (step S13) or again greater thanthreshold Th2 that it reached (step S23).

To this end, processing unit SPU2 tries to bring reference signal Sr toa value as close as possible to that of detection signal Sd. It may bethat an exact equality between the two signals cannot be obtained due torapid fluctuations of signal Sd during the readjustment phase, linked tothe usage conditions (for example the distance between the detectedobject and the sensor changes constantly). Thus, in the presence offluctuations of signal Sd, a deviation of signal Sr relative to signalSd may be noted at the end of the readjustment step. This deviationshould in practice be less than the difference between the value ofreadjusted signal Sr and the threshold that it reached, that is to say,less than offset OF1 or OF2.

The readjustment step of signal Sd is preferably done by disregardinginstantaneous variations of signal Sd, such as possible parasiticoscillations, which may falsify the readjustment of signal Sr. Itcomprises for example a calculation of the average value of signal Sd,based on the signal Sd values received during the readjustment period,that is, after the reaching of threshold Th1 or Th2. It may alsocomprise the application of a filtering function to signal Sd, to obtainthe readjusted signal Sr. This filtering may be of the same type as thatimplemented during steps S00 and S02, but with a lower time constant T2in order to readjust as quickly as possible the signal Sr value.

The duration of the readjustment step determines, in relation withsampling or refresh frequency Fs of signal Sd, the number of signal Sdvalues used to readjust signal Sr. This duration may be chosen to belonger if no delaying step S12 or S22 is provided. The choice of theduration of readjustment steps S13 or S23 and of delaying steps S12 orS22 is within the purview of the skilled person and may vary accordingto the intended application.

At the end of the readjustment step, reference signal Sr thus againfinds itself set on detection signal Sd, which allows detector DCT2 toadapt to environmental conditions susceptible of making detection signalSd vary while the detector is in the detecting state.

Two examples illustrating the functioning of detector DTC2 will now bedescribed in relation with FIGS. 6A, 6B and 7A, 7B which show twodifferent scenarios.

The scenario illustrated in FIGS. 6A, 6B corresponds to the case wherethe environmental parameters do not vary significantly while thedetector detects an object. It is supposed in this example that delayingsteps S12, S22 are not implemented.

The scenario shown in FIGS. 7A, 7B corresponds to the case where asudden variation of environmental parameters intervenes while thedetector detects an object.

FIGS. 6A, 7A show signals Sd, Sr and thresholds Th1, Th2. FIGS. 6B, 7Bshow values DET or NDET of state signal ST at different instants.

Scenario 1, FIGS. 6A, 6B

At instant t0, an object approaches the detector and the value of signalSd begins to increase. Signal Sr varies little due to the filtering timeconstant, this variation not being shown in FIG. 6A for the sake ofsimplicity. At instant t1, the value of signal Sd reaches threshold Th1,which is detected at step S04 and causes the detector to go into stateDET at step S11 (steps S04, S11 being considered here asquasi-simultaneous). Between instant t1 and an instant t2, the detectorexecutes readjustment step S13 and signal Sd is brought to a valuesubstantially equal to that of signal Sr at the end of step S13. SignalSd goes back below threshold Th1. At instant t3, the object moves awayfrom the detector and the value of signal Sd begins to decrease. At aninstant t4, the value of signal Sd reaches threshold Th2, which isdetected at step S05 and causes the detector to go into state NDET atstep S21. Between instant t4 and an instant t5, the detector executesthe readjustment step S23 and signal Sd is again brought to a valuesubstantially equal to that of signal Sr at the end of step S23.

It is therefore noted that the detector has a hysteresis response withautomatic adjustment of signal Sr as a central detection thresholdaround which detecting thresholds Th1, Th2 articulate, defining thishysteretic response. In the absence of sudden variations ofenvironmental parameters during the object detection phase, thishysteretic response with automatic adjustment of the central thresholddoes not offer a new technical effect relative to the method shown inFIGS. 2A, 2B. It is otherwise in the case of the scenario illustrated inFIGS. 7A, 7B, which will now be described.

Scenario 2, FIGS. 7A, 7B

At instant t0, an object approaches the detector and the value of signalSd begins to increase, whereas signal Sr does not perceptibly change dueto the filtering time constant. At an instant t1, the value of signal Sdreaches threshold Th1, which is detected at step S04 and causes thedetector to go into state DET at step S11. Between instant t1 and aninstant t2, the detector counts a wait time (step S12) in order to allowsignal Sd to stabilize. Between instant t2 and an instant t3, thedetector executes the readjustment step S13 and signal Sd is brought toa value substantially equal to that of signal Sr at the end of step S13.Signal Sd goes back therefore below threshold Th1.

At an instant t4, the object still being present, the environmentalparameters change and cause the value of detection signal Sd toincrease, whereas signal Sr does not substantially change due to thefiltering time constant. At an instant t5, the value of signal Sd againreaches threshold Th1, which is detected at step S04, without causingthe detector state to change because it is already in state DET (goesdirectly from step S10 to step S12). Between instant t5 and an instantt6, the detector counts a wait time (step S12) in order to allow signalSd to stabilize. Between instant t6 and an instant t7, the detectorexecutes readjustment step S13 and signal Sd is again brought to a valuesubstantially equal to that of signal Sr at the end of step S13. SignalSd goes back below threshold Th1.

At an instant t8, the object moves away from the detector and the valueof signal Sd begins to decrease, while the new environmental parameterscontinue to affect signal Sd. At an instant t9, the value of signal Sdreaches threshold Th2, which is detected at step S05 and causes thedetector to go into state NDET at step S21. Between instant t9 and aninstant t10, the detector counts a wait time (step S22) in order to letsignal Sd stabilize. Between instant t10 and an instant t11, thedetector executes a readjustment step S23 and signal Sd is again broughtto a value substantially equal to that of signal Sr at the end of stepS23.

In contrast with the example shown in FIGS. 3A, 3B, this example showsthat the hysteretic response of the detector with automatic adjustmentof reference signal Sr, allows it to automatically adapt to variationsof environmental parameters without affecting its ability to detectvariations of signal Sd representative of an object to detect beingmoved closer or farther.

FIG. 8 is a flow chart describing an implementation variation of themethod in the case where sensor 10 supplies a detection signal Sd, thevalue of which decreases as the object approaches the sensor. Thismethod is equivalent to that of FIG. 5 and only comprises an inversionof the position of thresholds Th1, Th2, threshold Th1 being arrangedbelow the reference signal and threshold Th2 arranged above signal Sr.Thus, the steps shown in FIG. 8 are identical to those of FIG. 5, withthe exception of step S04, which is replaced by a step S04′, and of stepS05, which is replaced by a step S05′.

At step S04′, unit SPU2 calculates threshold Th1 and determines whetherthe current value of detection signal Sd is less than this threshold.Threshold Th1 is calculated here by subtracting offset OF1 from thecurrent value of reference signal Sr, that is Th1=Sr−OF1. If signal Sdis less than Th1, unit SPU2 goes to step S10, otherwise it goes to stepS05′.

At step S05′, unit SPU2 calculates threshold Th2 and determines whetherthe current value of detection signal Sd is greater than this threshold.Threshold Th2 is calculated by adding offset OF2 to the current value ofsignal Sr, that is Th2=Sr+OF2. If signal Sd is greater than Th2, unitSPU2 goes to step S20, otherwise it returns to step S01.

It will clearly appear to the skilled person that the method of thedisclosure may be implemented with any type of proximity sensor,including optical, supplying a detection signal having a value thatincreases, or respectively decreases, as a function of the proximity ofthe detected object. The method offers a particular advantage when thevalue of the detection signal is sensitive to environmental parameters.

Moreover, the term “filtering” designates, in the present application,any type of digital or analog processing allowing rapid variations ofsignal Sd to be filtered to obtain a reference signal Sr that follows,with a lag time, the slow variations of signal Sd, and which thus hasthe same value as signal Sd when it is not fluctuating. Methods basedfor example on the calculation of the ponderated average value ofsamples of signal Sd could also allow signal Sd to be supplied.

A detector according to disclosure is equally susceptible to diverseembodiments and applications. Unit SPU2 is not necessarily a dedicatedcalculation unit and may be the processor of a portable object in whichsensor 10 is incorporated. In this case, the processor can be suppliedwith a program comprising an executable code allowing it to implementthe method.

Furthermore, a detector according to disclosure may be made as a touchdetector. The term “proximity detection” includes, in the presentapplication, the term “touch detection”.

FIG. 9 schematically shows a portable object HD comprising a processorPROC and elements 20, 21 controlled by the processor. Element 20 is forexample a touch screen and element 21 is for example an audio-frequencyamplifier intended to be connected to headphones 22. Processor PROC isfor example the baseband processor of a mobile telephone, the processorof an audio player, or of a PDA.

Portable object HD is equipped with a first proximity sensor 10 and asecond proximity sensor 10′. Sensor 10 has a sensitive portion 11arranged to detect the presence of a part of the body, for example theuser's head, proximate the portable object HD. Sensor 10′ has asensitive portion 11′ arranged in the headphones to detect whether ornot the headphones are being worn by the user.

Processor PROC is used as processing unit SPU2 and receives animplementation program of a method according to disclosure of processingdetection signals Sd, Sd′ supplied by sensors 10, 10′. Processor PROC isalso configured to activate or deactivate elements 20 and 21 accordingto state DET or NDET that it determines for each sensor 10, 10′ fromsignals Sd, Sd′. Thus, if element 20 is a touch screen, processor PROCis configured to lock the screen when it detects, by means of sensor 10,that a user has placed the portable object against his head. If element21 is an audio amplifier, processor PROC is configured to activate theamplifier when it detects, by means of sensor 10′, that the user hasplaced the headphones on his head.

The various embodiments described above can be combined to providefurther embodiments. These and other changes can be made to theembodiments in light of the above-detailed description. In general, inthe following claims, the terms used should not be construed to limitthe claims to the specific embodiments disclosed in the specificationand the claims, but should be construed to include all possibleembodiments along with the full scope of equivalents to which suchclaims are entitled. Accordingly, the claims are not limited by thedisclosure.

The invention claimed is:
 1. A method, comprising: detecting an objectusing a detection signal supplied by a proximity sensor, the detectionsignal having a value that changes as a function of the proximity of theobject to the proximity sensor, the detecting including: generating areference signal by filtering the detection signal; defining a firstdetection threshold relative to the reference signal; going from anobject non-detecting state to an object detecting state in response todetecting the detection signal crossing the first detection threshold ina first direction; and in response to detecting the detection signalcrossing the first detection threshold in the first direction,readjusting a value of the reference signal based on the detectionsignal and setting the first detection threshold based on the readjustedvalue of the reference signal such that the detection signal againcrosses the first detection threshold in a second direction opposite tothe first direction.
 2. A method according to claim 1, comprising, whilein the object detecting state: detecting that the detection signal againcrosses the first detection threshold in the first direction; and againreadjusting the value of the reference signal, in a manner such that thedetection signal again crosses the first detection threshold in thesecond direction, in response to detecting that the detection signalagain crosses the first detection threshold in the first direction.
 3. Amethod according to claim 1, comprising: defining a second detectionthreshold relative to the reference signal, going from the objectdetecting state to the object non-detecting state in response todetecting that the detection signal crosses the second detectionthreshold in the second direction, and in response to detecting that thedetection signal crosses the second detection threshold in the seconddirection, readjusting the value of the reference signal in a mannersuch that the detection signal crosses the second detection threshold inthe first direction.
 4. A method according to claim 3, comprising, whilein the object detecting state: detecting that the detection signal againcrosses the second detection threshold in the second direction; andagain readjusting the value of the reference signal, in a manner suchthat the detection signal again crosses the second detection thresholdin the first direction, in response to detecting that the detectionsignal again crosses the second detection threshold in the seconddirection, without modifying the non-detecting state.
 5. A methodaccording to claim 3, wherein defining the second detection thresholdincludes adding or subtracting an offset to the value of the referencesignal.
 6. A method according to claim 1, wherein defining the firstdetection threshold includes adding or subtracting an offset value tothe value of the reference signal.
 7. A method according to claim 1,wherein readjusting the value of the reference signal is done in amanner such that the value of the detection signal is substantiallyequal to the value of the reference signal with a maximum deviation lessthan a difference between the value of the readjusted reference signaland the detection threshold, the crossing of which causes thereadjusting of the reference signal.
 8. A method according to claim 1,wherein the readjusting of the value of the reference signal is donefrom values of the detection signal after an instant where the value ofthe detection signal crosses the first detection threshold in the firstdirection.
 9. A method according to claim 1, wherein the value of thedetection signal is an amplitude, a frequency, a phase, a duration, or anumber.
 10. A method according to claim 1, wherein going from the objectdetecting state to the object non-detecting state, or vice-versa,comprises modifying a value of a state signal or a state register.
 11. Amethod according to claim 1, wherein the object is a part of the humanbody.
 12. A method according to claim 1, wherein the proximity sensor isa capacitive proximity sensor that supplies the detection signal.
 13. Anon-transitory computer readable medium, comprising program codeconfigured to cause one or more processors to implement a method thatincludes: detecting an object using a detection signal supplied by aproximity sensor, the detection signal having a value that changes as afunction of the proximity of the object to the proximity sensor, thedetecting including: generating a reference signal by filtering thedetection signal; defining a first detection threshold relative to thereference signal; going from an object non-detecting state to an objectdetecting state in response to detecting the detection signal crossingthe first detection threshold in a first direction; and in response todetecting the detection signal crossing the first detection threshold inthe first direction, readjusting a value of the reference signal basedon the detection signal and setting the first detection threshold basedon the readjusted value of the reference signal such that the detectionsignal again crosses the first detection threshold in a second directionopposite to the first direction.
 14. A non-transitory computer readablemedium according to claim 13, wherein the method comprises, while in theobject detecting state: detecting that the detection signal againcrosses the first detection threshold in the first direction; and againreadjusting the value of the reference signal in a manner such that thedetection signal again crosses the first detection threshold in thesecond direction in response to detecting that the detection signalagain crosses the first detection threshold in the first direction. 15.A non-transitory computer readable medium according to claim 13, whereinthe method comprises: defining a second detection threshold relative tothe reference signal, going from the object detecting state to theobject non-detecting state in response to detecting that the detectionsignal crosses the second detection threshold in the second direction,and in response to detecting that the detection signal crosses thesecond detection threshold in the second direction, readjusting thevalue of the reference signal in a manner such that the detection signalcrosses the second detection threshold in the first direction.
 16. Anon-transitory computer readable medium according to claim 15, whereinthe method comprises, while in the object detecting state: detectingthat the detection signal again crosses the second detection thresholdin the second direction; and again readjusting the value of thereference signal in a manner such that the detection signal againcrosses the second detection threshold in the first direction inresponse to detecting that the detection signal again crosses the seconddetection threshold in the second direction, without modifying thenon-detecting state.
 17. A proximity detector comprising: a proximitysensor configured to supply a detection signal having a value thatchanges based on a proximity of an object to the sensor; and aprocessing unit configured to receive the detection signal, wherein theprocessing unit is configured to: generate a reference signal byfiltering the detection signal; define a first detection thresholdrelative to the reference signal; go from an object non-detecting stateto an object detecting state in response to detecting the detectionsignal crossing the first detection threshold in a first direction; andin response to detecting the detection signal crossing the firstdetection threshold in the first direction, readjust a value of thereference signal based on the detection signal and set the firstdetection threshold based on the readjusted value of the referencesignal such that the detection signal again crosses the first detectionthreshold in a second direction opposite to the first direction.
 18. Theproximity detector according to claim 17, wherein the proximity sensorincludes a sensitive portion and a sensor controller configured to readand control the sensitive portion.
 19. A portable device, comprising: afirst element that can be activated and deactivated; and a firstproximity detector configured to activate or deactivate the firstelement when an object is detected in proximity of the device, the firstproximity detector including: a proximity sensor configured to supply adetection signal having a value that changes based on a proximity of anobject to the sensor; and a processing unit configured to receive thedetection signal, wherein the processing unit is configured to: generatea reference signal by filtering the detection signal; define a firstdetection threshold relative to the reference signal; go from an objectnon-detecting state to an object detecting state in response todetecting the detection signal crossing the first detection threshold ina first direction; and in response to detecting the detection signalcrossing the first detection threshold in the first direction, readjusta value of the reference signal based on the detection signal and setthe first detection threshold based on the readjusted value of thereference signal such that the detection signal again crosses the firstdetection threshold in a second direction opposite to the firstdirection.
 20. The portable device according to claim 19, wherein theproximity sensor includes a sensitive portion and a sensor controllerconfigured to read and control the sensitive portion.
 21. The portabledevice according to claim 19, comprising: a second element that can beactivated and deactivated; and a second proximity detector configured toactivate or deactivate the second element when the object contacts thedevice.